package com.lingkang.sales.controller.user;

import com.lingkang.sales.config.aop.DefaultPageValid;
import com.lingkang.sales.data.dto.ResponsePageResult;
import com.lingkang.sales.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author linke
 * @date 2020/11/19 23:22
 * @description
 */
@Controller
@RequestMapping("/user/group")
public class GroupController {

  @Autowired
  private GroupService groupService;

  @GetMapping("find")
  public String find(){
    return "/user/group_find";
  }

  @GetMapping("list")
  @ResponseBody
  @DefaultPageValid
  public ResponsePageResult find(String comCode, String groupName, String groupCode, Integer page, Integer size) {
    return groupService.getGroup(comCode, groupName, groupCode, page, size);
  }

}
